
namespace CSharpPro._0922;
using System;
public class Demo
{
    public static bool TestPrint01()
    {
        Console.Write("请输入一个年份:");
        int year = int.Parse(Console.ReadLine());
        bool LeapYear = (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
        Console.WriteLine(LeapYear ? "闰年" : "平年");
        return LeapYear;
    }

    public static double TestPrint02()
    {
        Console.Write("请输入出行月份(1-12):");
        int month = int.Parse(Console.ReadLine());
        Console.Write("请输入交通方式(1:航班, 2:动车):");
        int transportType = int.Parse(Console.ReadLine());
        
        double originalPrice = 8800;
        double discount = 0;
        if (month >= 5 && month <= 10)
        {
            discount = transportType == 1 ? 0.9 : 0.7;
        }
        else
        {
            discount = transportType == 1 ? 0.6 : 0.3;
        }
        double finalPrice = originalPrice * discount;
        Console.WriteLine($"最终价格: {finalPrice} 元");
        return finalPrice;
    }

    public static void Main01()
    {
        TestPrint01();
        TestPrint02();
        Console.ReadKey();
    }
}